﻿namespace NEclipse.CoreLib.Workspace.Views
{
  using System.Windows.Forms;

  /// <summary>
  /// User control for the project explorer.
  /// </summary>
  public partial class ProjectExplorerUserControl : UserControl
  {
    /// <summary>
    /// Initializes a new instance of the <see cref="ProjectExplorerUserControl"/> class.
    /// </summary>
    public ProjectExplorerUserControl()
    {
      this.InitializeComponent();
    }

    /// <summary>
    /// Initializeses the instance with the specified workspace manager.
    /// </summary>
    /// <param name="workspaceManager">The workspace manager.</param>
    public void Initialize(WorkspaceManager workspaceManager)
    {
      foreach (IProject p in workspaceManager.Projects)
      {
        this.treeView1.Nodes.Add(new TreeNode() { Name = p.Name, Tag = p });
      }
    }
  }
}
